import React, { Component } from 'react';
import style from './../style.scss';
import Tips from './../component/Toast/Tips/Tips';
import Select from './../component/Element/Select/Select';
import CustomLink from './../../router/CustomLink';
export default class Home extends Component {
  constructor() {
    super();
    this.state = {
      placeHolder: '请选择...',
      selectValue: null,
      selectList: [
        {
          value: 1,
          text: '飒飒的错错错'
        },
        {
          value: 2,
          text: '这种'
        },
        {
          value: 3,
          text: '文本3'
        },
        {
          value: 4,
          text: '12'
        },
        {
          value: 5,
          text: '22233333333333'
        }
      ]
    }
  }
  handle (){
    Tips.open({
      message: 'loaing'
    })
  }
  selectchange = (value) => {
    this.setState({
      selectValue: value.value
    },() => {
    });
  }
  render() {
    let { selectList, placeHolder, selectValue } = this.state;
    return (<div className={style.hello} onClick={this.handle}>
      <CustomLink to="/Calendar">日历</CustomLink>
      <Select
        options={selectList}
        placeHolder={placeHolder}
        value={selectValue}
        selectchange={this.selectchange}
      ></Select>
    </div>)
  }
}